package com.ysd.lis.controller;

import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.WkCalcBatch;
import com.ysd.lis.request.WkCalcBatchRequest;
import com.ysd.lis.service.WkCalcBatchService;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;


/**
 * 绩效考核-核算批次
 *
 * @author LuoXS
 * @date 2024/4/16
 * version 1.0
 */
@RestController
@RequestMapping("/wk/calc/batch")
public class WkCalcBatchController extends BaseController {

    @Autowired
    WkCalcBatchService service;

    @ApiOperation("绩效考核-核算批次列表（分页）")
    @GetMapping("/page")
    public Result pageList(WkCalcBatchRequest.PageParam pageParam) {
        return service.pageList(pageParam);
    }

    @ApiOperation("新增")
    @PostMapping("/add")
    @LogDetail(requestParam = "add", operationType = OperationType.INSERT, module = "绩效考核-核算批次", content = "新增", businessName = "calcBase")
    public Result add(@RequestBody WkCalcBatchRequest.AddParams params) {
        return service.add(params);
    }

    @ApiOperation("修改")
    @PostMapping("/update")
    @LogDetail(requestParam = "update", operationType = OperationType.UPDATE, module = "绩效考核-核算批次", content = "编辑", businessName = "calcBase")
    public Result update(@RequestBody WkCalcBatchRequest.UpdateParams params) {
        return service.updateDit(params);
    }

    @ApiOperation("删除")
    @PostMapping("/delete")
    @LogDetail(requestParam = "delete", operationType = OperationType.DELETE, module = "绩效考核-核算批次", content = "删除", businessName = "calcBase")
    public Result delete(@RequestBody WkCalcBatch deleteParams) {
        return service.delete(deleteParams);
    }

}
